package com.xqls.server.netty;

import com.xqls.server.dto.SoketCommonDto;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
/**
 * Created by Skeyedu on 2017/3/10.
 */
public class CommonEncoder  extends MessageToByteEncoder  {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, Object dto, ByteBuf byteBuf) throws Exception {

        if(dto instanceof  SoketCommonDto){
            SoketCommonDto dta=( SoketCommonDto) dto;
            dta.getEncode(byteBuf);
        }


    }



}
